/*
 *	Basic serial commands, directed at use by arduinolib
 *	Originally authored by Ian Hills
 */
/*
 * open_port(char *portname) - Open serial port portname. eg. /dev/ttyUSB0
 *
 * Returns the port id on success or -1 on error.
 */

int open_port(char *portname);

/*
 * set_baud(int port, int rate) - set baudrate to a port
 *
 * must input baudrate in correct format eg B19200
 * see (site) for details
 */

void set_baud(int port, int rate);

/*
 * write_bytes(int port, char data[]) - write bytes to a port
 */

void write_bytes(int port, unsigned char data[]);

/*
 * read_bytes(int port, int count) - read count bytes from a port
 * returns pointer to char array holding bytes read.
 */

int read_bytes(int port,char *buffer, int count);

/*
 * void set_read_delay(int port,int delay) - set the read bytes function to
 * wait for data.
 * delay == 0 no wait.
 * delay == 1 wait.
 */

void set_read_delay(int port, int delay);


/*
 * close_port(int port) - close port
 */
void close_port(int port);
